<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script type="text/javascript" src="/js/jquery-1.12.4.min.js"></script>
<script>
    $(function () {
        //显示数据
        $.ajax({
            url:'/selectall',
            type:'post',
            dataType:'json',
            data:$("#searchForm").serialize(), //表单参数,得到所有参数
            success:function(date){
                $("#mytable").empty();
                $.each(date,function(idx, item) {
                    var row = '<tr class="datarow""><td>'+item.eid+'</td><td>'+item.ename+'</td><td>'
                        +item.salary+'</td><td>'+item.did+'</td></tr>';
                    $("#mytable").append(row);
                })
            }

        })
    })
</script>
<body>
    <form action="" method="post" id="searchForm">
        <table align="center" border="1" width="600px" >
            <thead>
            <tr align="center">
                <th>员工ID</th>
                <th>员工姓名</th>
                <th>员工工资</th>
                <th>员工部门</th>
            </tr>
            </thead>
            <tbody id="mytable">

            </tbody>
        </table>
    </form>
</body>
</html>
